package com.lesson14.observe.jdk;

import java.util.Observable;
import java.util.Observer;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/10/2 14:20
 */
public class ConcreteObserver implements Observer
{
    private int state;

    public int getState()
    {
        return state;
    }

    public void setState(int state)
    {
        this.state = state;
    }

    @Override
    public void update(Observable o, Object arg)
    {
        state = ((ConcreteSubject)o).getState();
    }
}
